﻿Imports System
Imports System.Web
Imports System.Web.UI
Imports System.Web.UI.WebControls
Imports DotNetNuke
Imports System.IO
Imports NVPortal.Modules.NVNews
Partial Class Widget_WG_300_255
    Inherits System.Web.UI.Page
    Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Try
            If Not IsPostBack Then
                Dim ctlNews As New NV_NewsController
                Dim arrNews As ArrayList
                arrNews = ctlNews.TopNew(30, 0)
                Me.rptLastestNews.DataSource = arrNews
                Me.rptLastestNews.DataBind()
            End If
        Catch ex As Exception
            ProcessModuleLoadException(Me, ex)
        End Try
    End Sub
    Public Function GetUser(ByVal userid As Integer) As String
        If userid = -1 Then
            GetUser = "Độc giả"
        Else
            Return UserController.GetUser(0, userid, True).Username
        End If
    End Function
    Public Function FormatURL(ByVal sitem As String, ByVal strID As String, ByVal strLink As String) As String
        Return "/" & sitem & "/" & strID & "/" & ReplaceChuoi(strLink) & ".htm"
    End Function
    Public Function ReplaceChuoi(ByVal chuoi As String) As String
        Dim convert As String = Global.ReplaceChuoi.bodau(chuoi).Replace(" ", "-")
        Return convert
    End Function
End Class